package Concurrency4_GeekTime.Chapter23_Future;

import java.util.concurrent.*;

/**
 * 功能说明：
 * 开发人员：@author MaLi
 */
public class Base03_Future {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //测试Callable返回值
        ExecutorService pool = Executors.newFixedThreadPool(1);
        Future<String> future = pool.submit(new Callable<String>() {
            @Override
            public String call() throws Exception {
                return "ok";
            }
        });

        String result = future.get();
        System.out.println(result);
    }


}
